# Contributor: Matthias Ahouansou <matthias@ahouansou.cz>
# Maintainer: Matthias Ahouansou <matthias@ahouansou.cz>
pkgname=pipeline
pkgver=1.14.5
pkgrel=0
pkgdesc="Watch YouTube and PeerTube videos in one place"
url="https://gitlab.com/schmiddi-on-mobile/pipeline"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	appstream-glib
	cargo
	cargo-auditable
	desktop-file-utils
	gtk4.0-dev
	libadwaita-dev
	meson
	openssl-dev
"
subpackages="$pkgname-doc $pkgname-lang"
source="
	$pkgname-$pkgver.tar.gz::https://gitlab.com/schmiddi-on-mobile/pipeline/-/archive/v$pkgver/pipeline-v$pkgver.tar.gz
"
options="net !check" # no tests
builddir="$srcdir/$pkgname-v$pkgver"

prepare() {
	default_prepare

	meson setup build --prefix /usr
	sed -i "s/cargo build/cargo auditable build --frozen/" build/build.ninja
	CARGO_HOME="$builddir"/build/cargo-home cargo fetch --target="$CTARGET" --locked
}

build() {
	meson compile -C build
}

package() {
	meson install -C build --no-rebuild --destdir "$pkgdir"

	install -Dm 644 LICENSE "$pkgdir"/usr/share/licenses/"$pkgname"/LICENSE
}

sha512sums="
92d32d91c8e8acd3f93c71d5c7b0c13028c9e6667023a68d1b06d01e9fe576418ebdf5b2378c117d942d73f5f36be605138f02e04d587f2d801fd7b69af5c3f2  pipeline-1.14.5.tar.gz
"
